load(
    "@bazel_skylib//rules:common_settings.bzl",
    "bool_flag",
    "string_flag",
    "string_list_flag",
)
load(
    "//go/private:mode.bzl",
    "LINKMODE_NORMAL",
)

bool_flag(
    name = "static",
    build_setting_default = False,
    visibility = ["//visibility:public"],
)

bool_flag(
    name = "race",
    build_setting_default = False,
    visibility = ["//visibility:public"],
)

bool_flag(
    name = "msan",
    build_setting_default = False,
    visibility = ["//visibility:public"],
)

bool_flag(
    name = "pure",
    build_setting_default = False,
    visibility = ["//visibility:public"],
)

bool_flag(
    name = "debug",
    build_setting_default = False,
    visibility = ["//visibility:public"],
)

string_flag(
    name = "linkmode",
    build_setting_default = LINKMODE_NORMAL,
    visibility = ["//visibility:public"],
)

string_list_flag(
    name = "gc_linkopts",
    build_setting_default = [],
    visibility = ["//visibility:public"],
)

string_list_flag(
    name = "tags",
    build_setting_default = [],
    visibility = ["//visibility:public"],
)

string_flag(
    name = "cover_format",
    build_setting_default = "lcov",
    values = [
        "go_cover",
        "lcov",
    ],
    visibility = ["//visibility:public"],
)

filegroup(
    name = "all_files",
    testonly = True,
    srcs = glob(["**"]),
    visibility = ["//visibility:public"],
)

string_list_flag(
    name = "gc_goopts",
    build_setting_default = [],
    visibility = ["//visibility:public"],
)

label_flag(
    name = "pgoprofile",
    build_setting_default = ":empty",
    visibility = ["//visibility:public"],
)

filegroup(
    name = "empty",
    visibility = ["//visibility:public"],
)
